<div id="deliver_detail_modal" class="modal fade">
    <div id="deliver_detail" class="modal-dialog modal-lg" >
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">发货单详情</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                基本信息
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                            <table>
                                <tr><td>订单号：</td><td id="order_serial_id_show"></td></tr>
                                <tr><td>下单时间：</td><td id="createtime1"></td></tr>
                                <tr><td>发货时间：</td><td id="createtime2"></td></tr>
                                <tr><td>购货人：</td><td id="username"></td></tr>
                                <tr><td>总金额：</td><td id="price"></td></tr>
                                <tr><td>应付金额：</td><td id="realprice"></td></tr>
                            </table>
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                    <!-- /.col-sm-6 -->
                    <div class="col-sm-6">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                收货人信息
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                            <table>
                                <tr><td>收货人：</td><td id="receivename_show"></td></tr>
                                <tr><td>收货地址：</td><td id="address"></td></tr>
                                <tr><td>收货电话：</td><td id="phone"></td></tr>
                                <tr><td>收货时间：</td><td id="receivetime"></td></tr>
                            </table>
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                    <!-- /.col-sm-6 -->
                    <div class="col-sm-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                商品信息
                            </div>
                            <!-- /.panel-heading -->
                            <div class="panel-body">
                                <table class="table table table-hover table-bordered table-striped table-striped">
                                    <thead>
                                        <tr>
                                            <td>商品名称</td>
                                            <td>条形码货号</td>
                                            <td>价格</td>
                                            <td>数量</td>
                                            <td>属性</td>
                                            <td>库存</td>
                                            <td>小计</td>
                                        </tr>
                                    </thead>
                                    <tbody id="product">
                                        
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td colspan="7" style="text-align:right">
                                            商品总金额：<font id="product_price"></font>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="7" style="text-align:right">
                                                = 订单总金额：<font id="product_realprice"></font>
                                            </td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                            <!-- /.panel-body -->
                        </div>
                        <!-- /.panel -->
                    </div>
                    <!-- /.col-sm-6 -->

                    <div class="col-sm-12">
                        <button id="print_btn" class="btn btn-primary" align="center" onclick="print()">打印发货单</button>
                        <!-- /.panel -->
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<div id="print_area" style="display:none">
    <div style="font-size:0.5px">
    <p>小区快驹送货单</p>
    <p style="font-size:0.5px"><span>单号:</span><br><span id="print_order_serial_id"></span></p>
    <table style="font-size:0.5px;width:100%">
        <thead style="border-bottom:1px solid #333;">
            <tr>
                <td>品名</td>
                <td>数量</td>
                <td>单价</td>
                <td>金额</td>
            </tr>
        </thead>
        <tbody id="print_product">
            
        </tbody>
        <tfoot style="border-top:1px solid #333;">
            <tr>
                <td colspan="4">
                    售出商品数：<font id="print_product_num"></font>
                    &nbsp;运费：<font id="print_sendprice"></font>
                </td>
            </tr>
            <tr><td colspan="4">合计：<font id="print_realprice"></font></td></tr>
        </tfoot>
    </table>
    <table style="font-size:0.5px;width:100%">
        <tbody>
        <tr><td nowrap>本单分:</td><td>总分:</td></tr>
        <tr><td nowrap>下单时间:</td><td id="print_createtime1" nowrap></td></tr>
        <tr><td nowrap>收货人:</td><td id="print_receivename"></td></tr>
        <tr><td nowrap>收货电话:</td><td id="print_phone"></td></tr>
        <tr><td nowrap>收货地址:</td><td id="print_address"></td></tr>
        <tr><td nowrap>咨询电话:</td><td>4006-241-520</td></tr>
        </tbody>
    </table>
    <p>为您提供满意的上门服务！</p>
    </div>
</div>
<script>
function print(){
    //设置此订单为已打印
    $.ajax({
        url: '{:U("Admin/Order/updatePrint/")}',
        type: 'post',
        dataType: 'json',
        data:{
            "order_id":order_id
        }
    })
    .success(function(data){
        selectedRow.addClass('selected');
    });

    //打印控件
    $('#print_area').attr('style', '');
    $("#print_area").jqprint({
        debug: false, //如果是true则可以显示iframe查看效果（iframe默认高和宽都很小，可以再源码中调大），默认是false
        importCSS: true, //true表示引进原来的页面的css，默认是true。（如果是true，先会找$("link[media=print]")，若没有会去找$("link")中的css文件）
        printContainer: true, //表示如果原来选择的对象必须被纳入打印（注意：设置为false可能会打破你的CSS规则）。
        operaSupport: true//表示如果插件也必须支持歌opera浏览器，在这种情况下，它提供了建立一个临时的打印选项卡。默认是true
    });
    $('#print_area').attr('style', 'display:none');
}
</script>